<link rel="stylesheet" media="screen" href="/application/lib/datatables/css/vpad.css" />
<script type="text/javascript" src="/application/lib/datatables/js/jquery.dataTables.js"></script> 
<script> 
			$(document).ready( function() {
				$('#tbl_foods').dataTable( {
					"oLanguage": {
						"sProcessing":   "Processando...",
						"sLengthMenu":   "Mostrar _MENU_ registros",
						"sZeroRecords":  "Não foram encontrados resultados",
						"sInfo":         "Mostrando de _START_ até _END_ de _TOTAL_ registros",
						"sInfoEmpty":    "Mostrando de 0 até 0 de 0 registros",
						"sInfoFiltered": "(filtrado de _MAX_ registros no total)",
						"sInfoPostFix":  "",
						"sSearch":       "Buscar:",
						"sUrl":          "",
						"oPaginate": {
							"sFirst":    "Primeiro",
							"sPrevious": "<<",
							"sNext":     ">>",
							"sLast":     "Último"
						}
					},
					"bRetrieve": true,
					"sPaginationType": "full_numbers"
				});
			});
		</script>
<h1 class="page-title">Alimentos</h1>
<div class="container_12 clearfix leading">
	<div class="grid_12">
		 <div id="demo" class="clearfix"> 
			<table class="display" id="tbl_foods" border="1">
				<thead>
					<tr>
						<th></th>
						<th>Nome</th>
						<th>Medida</th>
						<th>g/ml</th>
						<th>kcal</th>
						<th>Cbo</th>
						<th>Ptn</th>
						<th>G. Tot</th>
						<th>G. Sat</th>
						<th>G. Trans</th>
						<th>Fbr</th>
						<th>Sódio</th>
					</tr>
				</thead>
				<tbody>
						<?php
							foreach ($foods as $row){
								echo '<tr class="gradeA">';
								echo '<td class="center"><a href="#alimentos/'.$row['id'].'">Editar</td>';
								echo '<td class="center">'.$row['name'].'</td>';
								echo '<td class="center">'.$row['m_name'].'</td>';
								echo '<td class="center">'.$row['gml'].'</td>';
								echo '<td class="center">'.$row['kcal'].'</td>';
								echo '<td class="center">'.$row['carb'].'</td>';
								echo '<td class="center" >'.$row['protein'].'</td>';
								echo '<td class="center">'.$row['fat_t'].'</td>';
								echo '<td class="center">'.$row['fat_s'].'</td>';
								echo '<td class="center">'.$row['fat_tr'].'</td>';
								echo '<td class="center">'.$row['fiber'].'</td>';
								echo '<td class="center">'.$row['sodium'].'</td>';
								echo '</tr>';
							}
						?>
				</tbody>
			</table>
		</div>
	</div>
</div>